<template>
    <div class="talk">
        <button @click="getLoveTalk">获取一句土味情话</button>
        <ul>
            <li v-for="item in talkList" :key="item.id">{{ item.title }}</li>
        </ul>
    </div>
</template>

<script setup lang="ts" name="LoveTalk">
  import { useTalkStore } from '@/store/loveTalk';
  import { storeToRefs } from 'pinia';

	let talkStore = useTalkStore()
    let {talkList} = storeToRefs(talkStore)

	function getLoveTalk(){
		talkStore.getATalk()
	}

</script> 

<style scoped>
    .talk{
        margin: 10px 0;
        background-color: orange;
        border-radius: 10px;
        box-shadow: 0 0 10px;
    }   
    ul{
      padding-bottom: 20px;
    }
    .talk >button{
        margin: 10px 10px ;
    }
</style>